import request from "@/utils/request";

export function fileUpload(url:string,file: File){
    const formData = new FormData()
    formData.append('file', file)
    return request({
        headers: {
            'Content-Type': 'multipart/form-data'
        },
        url: url,
        method: "post",
        data: formData
    });
}
export function reqCheckChunkFile(md5,index){
    return request({
        url:"/file/share/chunk/check",
        method: "get",
        params: {
            md5,
            index
        }
    });
}

/**
 *获取图形验证码
 * @export
 * @return {*}
 */
export function reqCaptcha() {
    return request({
        url: "/auth/captcha",
        method: "get",
    });
}
export function reqGetPhoneCaptcha(phone: string) {
    return request({
        url: "/auth/phone/captcha",
        method: "get",
        params: {
            phone
        }
    });
}
